<?php

/**
 * tblRooms form base class.
 *
 * @method tblRooms getObject() Returns the current form's model object
 *
 * @package    travis
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasetblRoomsForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'hotel_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('HotelRooms'), 'add_empty' => true)),
      'name'           => new sfWidgetFormInputText(),
      'code_name'      => new sfWidgetFormInputText(),
      'description_en' => new sfWidgetFormInputText(),
      'description_ru' => new sfWidgetFormInputText(),
      'description_he' => new sfWidgetFormInputText(),
      'adult'          => new sfWidgetFormInputText(),
      'children'       => new sfWidgetFormInputText(),
      'baby'           => new sfWidgetFormInputText(),
      'photo'          => new sfWidgetFormInputText(),
      'status'         => new sfWidgetFormInputText(),
      'create_time'    => new sfWidgetFormDateTime(),
      'update_time'    => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'hotel_id'       => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('HotelRooms'), 'required' => false)),
      'name'           => new sfValidatorPass(array('required' => false)),
      'code_name'      => new sfValidatorPass(array('required' => false)),
      'description_en' => new sfValidatorPass(array('required' => false)),
      'description_ru' => new sfValidatorPass(array('required' => false)),
      'description_he' => new sfValidatorPass(array('required' => false)),
      'adult'          => new sfValidatorInteger(array('required' => false)),
      'children'       => new sfValidatorInteger(array('required' => false)),
      'baby'           => new sfValidatorInteger(array('required' => false)),
      'photo'          => new sfValidatorPass(array('required' => false)),
      'status'         => new sfValidatorInteger(array('required' => false)),
      'create_time'    => new sfValidatorDateTime(array('required' => false)),
      'update_time'    => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('tbl_rooms[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'tblRooms';
  }

}
